1. Field of the Invention
The present invention relates to an image decoding technique.
2. Description of the Related Art
The recent advance of semiconductor technologies is amazing to allow many digital cameras to capture high-resolution images, and the data sizes of captured images are increasing accordingly. Most of images captured by digital cameras are compression-encoded by an encoding method such as JPEG, and are then recorded in recording media. For this reason, in order to confirm a captured image on, for example, a display of a digital camera main body, encoded image data has to be decoded in predetermined procedures.
Various encoding methods for still images such as a JPEG encoding method are available. In JPEG encoding, image data is divided into a plurality of blocks each having a predetermined size. These blocks become the unit of encoding and data included in respective blocks undergo orthogonal transform. Then transformation coefficients after this orthogonal transform undergo quantization and coefficient prediction in turn. Furthermore, the data after the coefficient prediction undergo scan, and are converted from two-dimensional data into one-dimensional data including significant coefficients (nonzero data: levels) and a zero runlength of insignificant coefficients (zero data: runs). From the one-dimensional data, which is converted in this way, a plurality of syntax elements are generated, and are entropy-encoded. Finally, codes generated by the entropy encoding are coupled in a predetermined order, thus generating an encoded stream.
In encoding of a JPEG XR encoding method (to be simply referred to as JPEG XR hereinafter), which has been internationally standardized in recent years, as shown in FIG. 4, a prediction error after coefficient prediction is divided into a sign bit (flag) and absolute value. This absolute value is further divided into upper data and lower data, which are respectively encoded by different methods.
After the upper data undergoes adaptive scan, run/level syntax elements are generated, undergo variable-length encoding, and are coupled as an encoded stream. The lower data undergoes adaptive fixed-length coding. In JPEG XR, The transformation coefficient after orthogonal transform consists of DC, Low-pass (LP), and High-pass (HP) coefficients. The adaptive fixed-length coded part of the lower data of DC or lowpass (LP) coefficient is called FLC refinement and that of highpass (HP) coefficient is called flexbits. Hereinafter, both of FLC refinement and flexbits are referred to as semi-fixed-length data. The lower data is coupled to the encoded stream as semi-fixed-length data.
For this reason, in decoding of JPEG XR, transformation coefficient prediction errors for one block can be obtained only after the variable-length codes are decoded, and the semi-fixed-length data are also decoded. Also, before completion of the variable-length decoding, the start position of the semi-fixed-length data in encoded stream cannot be specified. In addition, since the data length (Modelbits in FIG. 4) of the semi-fixed-length data changes depending on the variable-length decoding result, it is difficult to parallelly decode the variable-length code and semi-fixed-length data. As techniques for quickly decoding an encoded stream including a plurality of encoding methods like in the JPEG XR, patent literature 1 (Japanese Patent Laid-Open No. 2010-093522) and patent literature 2 (Japanese Patent Laid-Open No. 2009-273106) are known.
A decoding apparatus described in patent literature 1 has a plurality of variable-length code decoders, and a single Flexbits decoder, and speeds up decoding processing by parallelly decoding a variable-length code and Flexbits. However, in the JPEG XR, since there are a large number of syntax elements in the variable-length encoding, each variable-length code decoder (to be simply referred to as a variable-length decoder hereinafter) requires a large circuit scale. When the plurality of such variable-length decoders are included, the processing performance improvement and a very large increase in circuit scale are required at the same time.
A decoding apparatus described in patent literature 2 has a variable-length decoder and Flexbits decoder. Furthermore, a start code of a tile header included in an encoded stream is identified, and the start position of the variable-length code and that of the Flexbits are specified based on this information. Then, the variable-length code and Flexbits are parallelly decoded, thereby speeding up the decoding processing. However, this technique is premised on decoding of the stream encoded in a frequency mode of the JPEG XR, which has two types of encoding modes (spatial mode and frequency mode). Since an encoded stream encoded in the spatial mode does not include any header required to identify the start positions of the variable-length code and Flexbits, the start positions of respective codes cannot be specified.
As described above, when the related arts are applied to decoding of a JPEG XR encoded stream, parallel decoding processing of the variable-length code and Flexbits can be executed. However, the circuit scale is greatly increased, or the decoding processing is limited to the specific encoding mode, thus posing problems.